{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_jypx/template/public/ygcsslist.css">
<style type="text/css">
    .yg5_key>div{float: left;line-height: 34px;}
    .store_td1{height: 45px;}
    .store_list_img{width: 60px;height: 60px;}
    .yg5_tabel{border-color: #e5e5e5;outline: 1px solid #e5e5e5;}
    .yg5_tr2>td{padding: 10px 15px;border: 1px solid #e5e5e5;text-align:center;}
    .yg5_tr1>th{
        border: 1px solid #e5e5e5;
        padding-left: 15px;
        background-color: #FAFAFA;
        font-weight: bold;
        text-align: center;
    }
    .yg5_btn{background-color: #EEEEEE;color: #333;border: 1px solid #E4E4E4;border-radius: 6px;width: 100px;height: 34px;}
    /*#frame-2{display: block;visibility: visible;}*/
</style>
<ul class="nav nav-tabs">
  <li  {if $type=='all'} class="active" {/if}><a href="{php echo $this->createWebUrl('order')}">全部列表</a></li>
  <li   {if $type=='published'} class="active" {/if}><a href="{php echo $this->createWebUrl('order',array('type'=>published,'state'=>1));}">进行中</a></li>
   <li   {if $type=='finished'} class="active" {/if}><a href="{php echo $this->createWebUrl('order',array('type'=>finished,'state'=>3));}">待退款</a></li>
   <li   {if $type=='finished1'} class="active" {/if}><a href="{php echo $this->createWebUrl('order',array('type'=>finished1,'state'=>4));}">已退款</a></li>
  <!--<li   {if $type=='cancel'} class="active" {/if}><a href="{php echo $this->createWebUrl('ddgl',array('type'=>cancel,'status'=>2));}">已取消</a></li>-->
  <!--<li   {if $type=='complete'} class="active" {/if}><a href="{php echo $this->createWebUrl('ddgl',array('type'=>complete,'status'=>4));}">已完成</a></li>-->
    <!--<li   {if $type=='refund'} class="active" {/if}><a href="{php echo $this->createWebUrl('ddgl',array('type'=>refund,'status'=>5));}">待退款</a></li>-->
    <!--<li   {if $type=='completerefund'} class="active" {/if}><a href="{php echo $this->createWebUrl('ddgl',array('type'=>completerefund,'status'=>6));}">已退款</a></li>-->
    <!--<li   {if $type=='reject'} class="active" {/if}><a href="{php echo $this->createWebUrl('ddgl',array('type'=>reject,'status'=>7));}">退款拒绝</a></li>-->
</ul>

  

<div class="main">
    <!-- <div class="panel panel-default">
        <div class="panel-body">
            <a class="btn btn-primary" href="javascript:location.reload()"><i class="fa fa-refresh"></i>刷新</a>
        </div>
    </div> -->
        <div class="panel panel-default">
            <div class="panel-body">
                <!--<div class="col-md-3">-->
                    <!-- <a class="btn btn-primary" href="javascript:location.reload()"><i class="fa fa-refresh"></i>刷新</a> -->
                    <!-- 批量部分 -->
                    <!--<button class="btn btn-default ygshanchu" id="allselect">批量删除</button>-->
                <!--</div>-->
                <form action="" method="get" class="col-md-4">
                    <input type="hidden" name="c" value="site" />
                    <input type="hidden" name="a" value="entry" />
                    <input type="hidden" name="m" value="zh_wxc" />
                    <input type="hidden" name="do" value="order" />
                    <div class="input-group" style="width: 300px">
                        <input type="text" name="keywords" class="form-control" placeholder="请输入悬赏标题/手机号">
                        <span class="input-group-btn">
                    <input type="submit" class="btn btn-default" name="submit" value="查找"/>
                </span>
                    </div>
                    <input type="hidden" name="token" value="{$_W['token']}"/>
                </form>
                <!--<form class="col-lg-2" action="" method="POST">-->
                    <!--<div style="width: 100px">-->

                        <!--<input type="submit" class="btn btn-sm btn-success" name="export_submit" value="导出"/>-->
                        <!--<input type="hidden" name="token" value="{$_W['token']}"/>-->

                    <!--</div>-->
                <!--</form>-->


                <!-- 批量部分 -->
            </div>
        </div>

    <div class="panel panel-default">
        <div class="panel-heading">
            全部列表
        </div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
                <table class="yg5_tabel col-md-12">

                    <tr class="yg5_tr1">
                        <th class="store_td1 col-md-1">
                            <input type="checkbox" class="allcheck" />
                            <span class="store_inp">全选</span>
                        </th>

                        <th>发布者</th>
                        <th>头像</th>
                        <th>悬赏分类</th>
                        <th>悬赏标题</th>
                        <th>手机号</th>

                        <th>发布悬赏时间</th>
                        <th>结束时间</th>
                        <th>状态</th>
                        <th>审核状态</th>
                        <th>操作</th>

                    </tr>
                    {loop $list $key $item}
              <tr class="yg5_tr2">
                 <td>
                    <input type="checkbox" name="test" value="{$item['id']}">
                 </td>

                  <td>
                      {$item['nickname']}
                  </td>
                  <td>
                      <img src="{$item['img']}" alt="" style="height: 60px;width: 60px">


                  </td>
                  <td>
                      {$item['name']}
                  </td>
                  <td >
                      {$item['title']}
                  </td>
                  <td>
                      {$item['phone']}
                  </td>

                 <td >
               {$item['created_time']}
                </td>
                 <td >
               {$item['end_time']}
                </td>
                  {if $item['state']==1}
                  <td >
                      <span class="label label-warning">进行中</span>
                  </td>
                  {elseif $item['state']==2}
                  <td >
                      <span class="label label-info"> 已结束</span>
                  </td>
                  {elseif $item['state']==3}
                  <td >
                      <span class="label label-warning">待退款</span>
                  </td>
                  {elseif $item['state']==4}
                  <td >
                      <span class="label label-info"> 已退款</span>
                  </td>
                  {/if}

                  {if $item['status']==0}
                  <td >
                      <span class="label label-warning">待审核</span>
                  </td>
                  {elseif $item['status']==1}
                  <td >
                      <span class="label label-info"> 已通过</span>
                  </td>
                  {elseif $item['status']==2}
                  <td >
                      <span class="label label-warning"> 已拒绝</span>
                  </td>
                  {/if}

            
                  <td>
                      
                      <a href="javascript:void(0);" class="storespan btn btn-xs" data-toggle="modal" data-target="#myModal{$item['id']}">
                          <span class="fa fa-trash-o"></span>
                          <span class="bianji">删除<span class="arrowdown"></span>
                                </span>
                      </a>
                      <a href="{php echo $this->createWebUrl('orderdetails',array('id'=>$item['id']));}" class="storespan btn btn-xs" style="width: 20px;padding-left: 3px">
                          <span class="fa fa-database"></span>
                          <span class="bianji">查看悬赏详情
                            <span class="arrowdown"></span>
                          </span>
                      </a>
                      <a href="{php echo $this->createWebUrl('checktask',array('id'=>$item['id']));}" class="storespan btn btn-xs" style="width: 20px;padding-left: 3px">
                          <span class="fa fa-database"></span>
                          <span class="bianji">查看凭证审核
                            <span class="arrowdown"></span>
                          </span>
                      </a>
                      <a href="{php echo $this->createWebUrl('score',array('id'=>$item['id']));}" class="storespan btn btn-xs" style="width: 20px;padding-left: 3px">
                          <span class="fa fa-database"></span>
                          <span class="bianji">查看悬赏评论
                            <span class="arrowdown"></span>
                          </span>
                      </a>
                  </td>

              </tr>
                    <div class="modal fade" id="myModal{$item['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                                </div>
                                <div class="modal-body" style="font-size: 20px">
                                    确定删除么？
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                    <a href="{php echo $this->createWebUrl('order', array('op' => 'delete', 'id' => $item['id']))}" type="button" class="btn btn-info" >确定</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal fade" id="myModalc{$item['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                                </div>
                                <div class="modal-body" style="font-size: 20px">
                                    确定要拒绝么？
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                    <a href="{php echo $this->createWebUrl('order', array('op'=>change,'status' => 2, 'id' => $item['id']))}" type="button" class="btn btn-info" >确定</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal fade" id="myModalb{$item['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                                </div>
                                <div class="modal-body" style="font-size: 20px">
                                    确定要通过么？
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                    <a href="{php echo $this->createWebUrl('order', array('op'=>change,'status' => 1, 'id' => $item['id']))}" type="button" class="btn btn-info" >确定</a>
                                </div>
                            </div>
                        </div>
                    </div>
                  {/loop}

                {if empty($list)}
               <tr class="yg5_tr2">
                  <td colspan="10">
                    暂无订单信息
                  </td>
                </tr>

              {/if}

                </table>
            </div>
        </form>
    </div>
    {$pager}
</div>
</div>
<script type="text/javascript">
    $(function(){
        // $("#frame-12").addClass("in");
        // $("#frame-12").show();
        $("#frame-1").show();
        $("#yframe-1").addClass("wyactive");

        $("#allselect").on('click',function(){
            var check = $("input[type=checkbox][class!=allcheck]:checked");
            if(check.length < 1){
                alert('请选择要删除的订单!');
                return false;
            }else if(confirm("确认要删除此订单?")){
                var ids = new Array();
                check.each(function(i){
                    ids[i] = $(this).val();
                });
               // console.log(id);return false;
                $.ajax({
                    type:"post",
                    url:"https://hl.zhycms.com/web/index.php?c=site&a=entry&op=display&do=order&m=zh_wxc&version_id=60",
                    dataType:"text",
                    data:{ids:ids},
                    success:function(data){
                        console.log(data);
                        // return false;
                        location.reload();
                    }
                })

            }
        });
        $(".allcheck").on('click',function(){
            var checked = $(this).get(0).checked;
            $("input[type=checkbox]").prop("checked",checked);
        });

    })
</script>